<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		#div1{
			position: absolute;
			top: 50px;
			left: 100px;
		}
		#div2{
			position: absolute;
			top:200px;
			left: 500px;
		}
		a{
			display: block;
			float: left;
			width: 20px;
			height: 20px;
			background: #ccc;
			border: 1px solid #fff;
			text-align: center;
			line-height: 20px;

		}
	</style>
	<script type="text/javascript">
		function $(id){
          return document.getElementById(id);
		}
		var i=1;
		var timer;
		function show(id){
			if(id){
               i=id;
               clearTimeout(timer);
			}
			var oSrc=$("imags");
        if(i<5){
	      oSrc.src="images/ad-0"+i+".jpg";
        }
         i++;
         if(i>=5){
           i=1;
         }
        timer=setTimeout(show, 2000);
		}
	window.onload=function(){
			show();
		}
	</script>
</head>
<body>
<div id="div1">
		<img src="images/ad-01.jpg" id="imags">
</div>
<div id="div2">
		<a onmouseover="show(1)">1</a>
		<a onmouseover="show(2)">2</a>
		<a onmouseover="show(3)">3</a>
		<a onmouseover="show(4)">4</a>
</div>
</body>
</html>